<?php

require_once('publiccontroller.php');

// Page d'accueil
class Home extends PublicController
{
	function Home()
	{
		parent::PublicController();
		$this->set_page_title('Accueil');
		$this->load->model('Content');
		$this->load->model('Post');
	}

	function index()
	{
		// contenu de la page d'accueil
		$data['content'] = $this->Content->get_by_key('home');

		// les dernières actualités
		$data['posts'] = $this->Post->get_page(1);
		$data['page'] = 1;
		$data['nb_pages'] = $this->Post->get_nb_pages();
		if (POSTS_TAG_CLOUD) {
			$data['tag_cloud'] = $this->Post->tag_cloud();
		}
		$this->_display('index', $data);
	}
}
